﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class RootMotionFinalIKIKSolverBoneWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(RootMotion.FinalIK.IKSolver.Bone);
			Utils.BeginObjectRegister(type, L, translator, 0, 3, 4, 4);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Swing", _m_Swing);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Swing2D", _m_Swing2D);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetToSolverPosition", _m_SetToSolverPosition);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "rotationLimit", _g_get_rotationLimit);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "length", _g_get_length);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "sqrMag", _g_get_sqrMag);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "axis", _g_get_axis);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "rotationLimit", _s_set_rotationLimit);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "length", _s_set_length);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "sqrMag", _s_set_sqrMag);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "axis", _s_set_axis);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 2, 0, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "SolverSwing", _m_SolverSwing_xlua_st_);
            
			
            
			
			
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new RootMotion.FinalIK.IKSolver.Bone();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.Transform>(L, 2))
				{
					UnityEngine.Transform _transform = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform));
					
					var gen_ret = new RootMotion.FinalIK.IKSolver.Bone(_transform);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.Transform>(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
				{
					UnityEngine.Transform _transform = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform));
					float _weight = (float)LuaAPI.lua_tonumber(L, 3);
					
					var gen_ret = new RootMotion.FinalIK.IKSolver.Bone(_transform, _weight);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to RootMotion.FinalIK.IKSolver.Bone constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 0)
				{
					
					var gen_ret = new RootMotion.FinalIK.IKSolver.Bone();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 1 && translator.Assignable<UnityEngine.Transform>(L, 1))
				{
					UnityEngine.Transform _transform = (UnityEngine.Transform)translator.GetObject(L, 1, typeof(UnityEngine.Transform));
					
					var gen_ret = new RootMotion.FinalIK.IKSolver.Bone(_transform);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.Transform>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
				{
					UnityEngine.Transform _transform = (UnityEngine.Transform)translator.GetObject(L, 1, typeof(UnityEngine.Transform));
					float _weight = (float)LuaAPI.lua_tonumber(L, 2);
					
					var gen_ret = new RootMotion.FinalIK.IKSolver.Bone(_transform, _weight);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to RootMotion.FinalIK.IKSolver.Bone constructor!");
            
        }

        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Swing(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 3&& translator.Assignable<UnityEngine.Vector3>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    UnityEngine.Vector3 _swingTarget;translator.Get(L, 2, out _swingTarget);
                    float _weight = (float)LuaAPI.lua_tonumber(L, 3);
                    
                    gen_to_be_invoked.Swing( _swingTarget, _weight );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.Vector3>(L, 2)) 
                {
                    UnityEngine.Vector3 _swingTarget;translator.Get(L, 2, out _swingTarget);
                    
                    gen_to_be_invoked.Swing( _swingTarget );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to RootMotion.FinalIK.IKSolver.Bone.Swing!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SolverSwing_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 4&& translator.Assignable<RootMotion.FinalIK.IKSolver.Bone[]>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable<UnityEngine.Vector3>(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) 
                {
                    RootMotion.FinalIK.IKSolver.Bone[] _bones = (RootMotion.FinalIK.IKSolver.Bone[])translator.GetObject(L, 1, typeof(RootMotion.FinalIK.IKSolver.Bone[]));
                    int _index = LuaAPI.xlua_tointeger(L, 2);
                    UnityEngine.Vector3 _swingTarget;translator.Get(L, 3, out _swingTarget);
                    float _weight = (float)LuaAPI.lua_tonumber(L, 4);
                    
                    RootMotion.FinalIK.IKSolver.Bone.SolverSwing( _bones, _index, _swingTarget, _weight );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 3&& translator.Assignable<RootMotion.FinalIK.IKSolver.Bone[]>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable<UnityEngine.Vector3>(L, 3)) 
                {
                    RootMotion.FinalIK.IKSolver.Bone[] _bones = (RootMotion.FinalIK.IKSolver.Bone[])translator.GetObject(L, 1, typeof(RootMotion.FinalIK.IKSolver.Bone[]));
                    int _index = LuaAPI.xlua_tointeger(L, 2);
                    UnityEngine.Vector3 _swingTarget;translator.Get(L, 3, out _swingTarget);
                    
                    RootMotion.FinalIK.IKSolver.Bone.SolverSwing( _bones, _index, _swingTarget );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to RootMotion.FinalIK.IKSolver.Bone.SolverSwing!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Swing2D(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 3&& translator.Assignable<UnityEngine.Vector3>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    UnityEngine.Vector3 _swingTarget;translator.Get(L, 2, out _swingTarget);
                    float _weight = (float)LuaAPI.lua_tonumber(L, 3);
                    
                    gen_to_be_invoked.Swing2D( _swingTarget, _weight );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.Vector3>(L, 2)) 
                {
                    UnityEngine.Vector3 _swingTarget;translator.Get(L, 2, out _swingTarget);
                    
                    gen_to_be_invoked.Swing2D( _swingTarget );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to RootMotion.FinalIK.IKSolver.Bone.Swing2D!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetToSolverPosition(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    
                    gen_to_be_invoked.SetToSolverPosition(  );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_rotationLimit(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.rotationLimit);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_length(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, gen_to_be_invoked.length);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_sqrMag(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, gen_to_be_invoked.sqrMag);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_axis(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineVector3(L, gen_to_be_invoked.axis);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_rotationLimit(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.rotationLimit = (RootMotion.FinalIK.RotationLimit)translator.GetObject(L, 2, typeof(RootMotion.FinalIK.RotationLimit));
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_length(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.length = (float)LuaAPI.lua_tonumber(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_sqrMag(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.sqrMag = (float)LuaAPI.lua_tonumber(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_axis(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                RootMotion.FinalIK.IKSolver.Bone gen_to_be_invoked = (RootMotion.FinalIK.IKSolver.Bone)translator.FastGetCSObj(L, 1);
                UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value);
				gen_to_be_invoked.axis = gen_value;
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
		
		
		
		
    }
}
